<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理中心</title>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/css/main.css" />
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/jquery.js"></script>

<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/jquery.colorbox.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/jQselect.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/load.js"></script>
<!--时间选择器-->
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/date/calendar.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/date/lang/cn_utf8.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/date/calendar-setup.js"></script>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/js/date/calendar-blue.css" />
<!--colorbox-->
<link href="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/colorbox2.css" rel="stylesheet" type="text/css"/>
</head>

<body>
	<div id="main">
		<div id="navigation">当前位置：商家订单列表</div>
<div id="topOtherMenu">
				<input type="button" name="insert" id="insert" value="添加商家订单" class="button" onclick="location.href='<?php echo $this->projectUrl(array('action'=>'insert'));?>';" />
			</div>
<div id="body">
			<div id="search">
		
                	<form id="form" name="form" method="post" action="">
					<table width="100%" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td>&nbsp;统计日期：
                              <input name="startTime" type="text" class="input" id="startTime" size="18" value="<?php echo $this->countDate ?   $this->countDate  : date('Y-m-d', strtotime("-1 day"));?>" />
								<script type="text/javascript">Calendar.setup({"ifFormat":"%Y-%m-%d","firstDay":0,"showsTime":true,"showOthers":false,"timeFormat":24,"inputField":"startTime","button":"startTime"});</script>
					          <input type="button" name="button" id="button" value="查找" class="button" onclick="searchForm();" />
                             
                             <span> &nbsp;&nbsp;月报下载：</span>
                              <select name="selectMonth" id="selectMonth">
                                 <option value="1">客户和Yek</option>
                                 <option value="2">客户</option>
                                 <option value="3">Yek</option>
                              </select>
                              <input type="button" class="button" name="button3" id="button3" value="下载月订单对比"  onclick="monthForm();" />
                              &nbsp; 日报下载：
                               
                                <select name="selectDay" id="selectDay">
                                 <option value="1">客户和Yek</option>
                                 <option value="2">客户</option>
                                 <option value="3">Yek</option>
                               </select>
                                <input type="button" class="button" name="button4" id="button4" value="下载日订单对比"  onclick="dayForm();" />
                               
&nbsp;					</td>
						</tr>
					</table>
				</form>
			</div>
           
			<div id="content">
				<form id="listForm" name="listForm" method="post" action="">
					<table class="table">
						<tr class="subject">
                     
							<td width="5%" class="checkBoxTd">选择</td>
                       
							<td>订单数量</td>
							<td>订单金额</td>
							<td>客单价</td>
						  <td>统计时间</td>
						  <td>添加时间</td>
						  <td class="checkBoxTd">操作</td>
						</tr>
                        <?php foreach($this->rows as $row):?>
						<tr class="dataLine">
                       
							<td width="5%" class="checkBoxTd"><input type="checkbox" name="selectId[]"  class="selectCheckBox" value="<?php echo $row['Id'];?>" /></td>
                          
							<td style="text-align:right;"><?php echo $row['orderNum'];?></td>
							<td style="text-align:right;"><?php echo '￥' . number_format($row['orderAmount'], 2, '.', ',');?></td>
							<td style="text-align:right;"><?php echo '￥' . number_format($row['orderPerprice'],2,'.',',');?></td>
							<td style="text-align:center;"><?php echo $row['countDate'];?></td>
							<td style="text-align:center;"><?php echo $row['addTime'];?></td>
							<td class="checkBoxTd"><a href="<?php echo $this->projectUrl(array('id'=>$row['Id'], 'action'=>'update','backUrl'=>urlencode($this->pageUrl)));?>">编辑</a></td>
						</tr>
                        <?php endforeach;?>
					</table>
<table class="controlTable">
						<tr>
							<td align="left"><input type="button" name="all" id="all" value="全选" class="button" onclick="$('.selectCheckBox').attr('checked', true);"/>
								<input type="button" name="cancel" id="cancel" value="取消" class="button" onclick="$('.selectCheckBox').attr('checked', false);"/>
                                
								<input type="submit" name="delete" id="delete" value="删除" class="button" onclick="return del();"/></td>
							 <td colspan="6" class="paginator"><div align="right"><?php echo $this->pageString;?></div></td>
		  </tr>
					</table>
			  </form>
			</div>
		</div>
</div>
<script language="javascript">
function del()
{
	if (confirm('确定删除吗？')) {
	
	
		$("#listForm").attr('action', '<?php echo $this->projectUrl(array('action'=>'delete','backUrl'=>urlencode($this->pageUrl))) ;?>');
		$("#listForm").submit();
		return true;
	} else {
		return false;
	}
}
</script>
<script>
function searchForm()
  {
   document.form.action = "<?php echo $this->projectUrl(array('action'=>'index'));?>";
   document.form.submit();
  }
function monthForm()
  {
   document.form.action = "<?php echo $this->projectUrl(array('action'=>'compare-month-report'));?>";
   document.form.submit();
  }
function dayForm()
  {
   document.form.action = "<?php echo $this->projectUrl(array('action'=>'compare-day-report'));?>";
   document.form.submit();
  }
</script>
</body>
</html>